package com.rd.teacher.jichao.day04;

import java.util.Calendar;

public class CalendarTest {

    public static void main(String[] args) {
        Calendar calendar = Calendar.getInstance();
        // 月份从0开始
        int month = calendar.get(Calendar.MONTH);
        // 12小时和24小时
        int hour  = calendar.get(Calendar.HOUR);
        int hour1  = calendar.get(Calendar.HOUR_OF_DAY);

        // 从周日开始计算
        int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
        int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
        int dayOfWeekInMonth = calendar.get(Calendar.DAY_OF_WEEK_IN_MONTH);
        int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR);
//
//        System.out.println(month);
//        System.out.println(hour);
//        System.out.println(hour1);


        System.out.println(dayOfWeek);
        System.out.println(dayOfMonth);
        System.out.println(dayOfWeekInMonth);
        System.out.println(dayOfYear);
    }
}
